
//时间戳转标准事件
function converTimestamp(timestamp = '1701222142'){
    const date = new Date(timestamp);
    const year = date.getFullYear();
    const month = date.getMonth() + 1;
    const day = date.getDate();
    const hours = date.getHours();
    const minutes = date.getMinutes();
    const seconds = date.getSeconds();
    const convertedTime = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
    console.log(convertedTime); // 输出转换后的时间
}

//获取手机验证码
function getSMS(){
    let phone = $(".phone-email").val();
    $.ajax({
        type:'post',
        url:`${baseUrl}/api/sms/send`,
        data:{
            "mobile":phone,
        },
        success:function(res){
            if ( res.code !== 200){
                alert('获取手机验证码失败！');
            }
        },
        error:function(res){
            alert('fail');
        }
    });
}